package com.platform.user.controller;

import com.platform.bean.Result;
import com.platform.user.dao.ChatMessageDao;
import com.platform.user.entity.ChatMessage;
import com.platform.user.service.ChatMessageService;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.io.IOException;
import java.util.List;
import java.util.Map;

@RestController
@RequestMapping("/chatMessage")
public class ChatMessageController {

    @Resource
    private ChatMessageService chatMessageService;

    @PostMapping("queryMessageByPage")
    public Result<Map<String, Object>> queryMessageByPage(@RequestBody Map<String, Object> params) {
        return Result.ok(chatMessageService.queryMessageByPage(params));
    }

    @PostMapping("uploadMessageImage")
    public Result<Map<String, Object>> uploadMessageImage(@RequestBody Map<String, Object> params) throws IOException {
        return Result.ok(chatMessageService.uploadMessageImage(params));
    }

}
